import VueCookies from 'vue-cookies'
// const baseUrl = "https://chat.hll666.xyz"
// const websoketUrl = 'wss://chat.hll666.xyz/websocket'
// VueCookies.set('language',language);
function getSocketUrl() {
    var language = VueCookies.get('language') ? VueCookies.get('language') : localStorage.getItem('locale')
    // var JSCOOKIE = VueCookies.get('JSCOOKIE')
    
    var JSCOOKIE = VueCookies.get('JSCOOKIE') ? VueCookies.get('JSCOOKIE') : VueCookies.get('JSCOOKIE_test')
    var platformName = window.location.host
    var protocol = process.env.NODE_ENV === 'development' ? 'https:' : window.location.protocol
    var domainName = process.env.NODE_ENV === 'development' ? 'chat.hll666.xyz' : platformName
    // var basewSocketUrl = protocol === 'https:' ? 'wss://' + domainName + '/websocket/' + JSCOOKIE + '/' + language : 'ws://' + domainName + '/websocket/' + JSCOOKIE + '/' + language
    var basewSocketUrl = protocol === 'https:' ? 'wss://' + domainName + '/websocket/' + JSCOOKIE + '/' + language : 'ws://' + domainName + '/websocket/' + JSCOOKIE + '/' + language
    // utils.domainName = domainName
    // utils.basewSocketUrl = basewSocketUrl
    return basewSocketUrl
    // return 'wss://chat.hll666.xyz/websocket'
  }

const baseUrl = '/'
// const websoketUrl = basewSocketUrl

//http://doc.hll666.xyz/web/#/3  147258369   接口地址   
export default { 
    baseUrl,
    getSocketUrl
}